home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tchk050.arc / VIDEO.H < prev   
C/C++ Source or Header  |  1988-11-19  |  3KB  |  69 lines

  1. /* TCHK 0.50 - Howard Kapustein's Turbo C library     11-18-87 */
  2. /* Copyright (C) 1987, Howard Kapustein.  All rights reserved. */
  3.  
  4. /* video.h  -  header file for VIDEO.C - screen output routines */
  5.  
  6. #include <howard.h>
  7.  
  8. #ifndef VIDEO
  9. #define VIDEO     0x10           /* VIDEO INTerrupt service = 16 (HEX 10) */
  10. #define MODE      *((byte far *) 0x449lu)          /* current video mode */
  11. #define PAGE      *((byte far *) 0x462lu)          /* current display page */
  12. #define PAGELEN   *((unsigned int far *) 0x44Clu)  /* current page length (regen buffer) */
  13. #define VIDOFFSET *((unsigned int far *) 0x44Elu)  /* offset from start of video */
  14. #define ROWCOUNT  *((byte far *) 0x484lu)          /* # rows minus 1 on display (EGA,PGA) */
  15. #define CHARHEIGHT *((unsigned int far *) 0x485lu) /* character height: # bytes/char, # scan lines/char (EGA,PGA) */
  16. #define CURSOR_UNDERBAR   (MODE==7)?0x0B0C:0x0607  /* cursor type: underbar (default) */
  17. #define CURSOR_HALFBLOCK  (MODE==7)?0x070C:0x0407  /* cursor type: half-block */
  18. #endif
  19.  
  20. /* function prototypes */
  21. void cls(void);
  22. void clear(int top, int left, int bottom, int right);
  23. void gotoxy(int x, int y);
  24. byte wherex(void);                /* returns X-coord of cursor */
  25. byte wherey(void);                /* returns Y-coord of cursor */
  26. void read_mode(byte *width, byte *mode, byte *page);
  27. void set_mode(byte mode);
  28. int box(int top, int left, int bottom, int right, byte frame[]);
  29. void horiz_line(byte c, unsigned int len, byte row, byte col);
  30. void vert_line(byte c, unsigned int len, byte row, byte col);
  31. void putk(byte c);
  32. void putstr(byte *c);             /* INTerrupt output */
  33. void putsay(byte row, byte col, byte *c);        /* direct screen writes */
  34. unsigned int read_cursor(byte *row, byte *col);    /* returns CX reg, scan lines */
  35. void set_cursor(byte start, byte end);      /* set cursor scan lines */
  36. void cursor_off(void);
  37. void cursor_on(void);
  38. void cursor_flip(unsigned int curs1, unsigned int curs2);   /* toggle cursor type */
  39. void set_color(byte colors);
  40. boolean isMDA(void);
  41. boolean isHerc(void);
  42. boolean isEGA(void);
  43. boolean isCGA(void);
  44. void save_screen(byte *buffer);           /* saves screen to buffer */
  45. void save_box(byte top, byte left, byte bottom, byte right, byte *buffer);
  46. void restore_screen(byte *buffer);   /* restores screen from buffer */
  47. void restore_box(byte top, byte left, byte bottom, byte right, byte *buffer);
  48. void scroll_up(byte top, byte left, byte bottom, byte right);
  49. void scroll_down(byte top, byte left, byte bottom, byte right);
  50.  
  51.  
  52. #ifndef ismono()
  53. #define ismono()   isMDA()|isHerc()
  54. #define iscolor()  !ismono()
  55. #endif
  56.  
  57.  
  58. /* The following global variables have been defined in the library:
  59.  
  60.     byte frame1[9] = {'┌','─','┐','│','┘','─','└','│','\0'};
  61.     byte frame11[5] = {'┬','├','┴','┤','┼'};
  62.     byte frame12[6] = {'╓','╞','╨','╡','╫','╪'};
  63.     byte frame2[9] = {'╔','═','╗','║','╝','═','╚','║','\0'};
  64.     byte frame21[6] = {'╤','╟','╧','╢','╪','╫'};
  65.     byte frame22[5] = {'╦','╠','╩','╣','╬'};
  66.     byte frame0[9] = {' ',' ',' ',' ',' ',' ',' ',' ','\0'};
  67.  
  68. */
  69.